AMD/IOMMU: Treat head/tail pointers as byte offsets
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sun, 2 Feb 2020 18:23:47 +0000 (18:23 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 11 Feb 2020 11:03:27 +0000 (11:03 +0000)
commit32db853d95fc8a3bf107c896bad7e4298a547ac9
tree8c78848d561cf5545ccb9e8533a9699751112152
parent6bb06bb0eb1528319998de602f969c474396c306
AMD/IOMMU: Treat head/tail pointers as byte offsets

The MMIO registers as already byte offsets.  Using them in this form removes
the need to shift their values for use.

It is also inefficient to store both entries and alloc_size (which only differ
by entry_size).  Rename alloc_size to size, and drop entries entirely, which
simplifies the allocation/deallocation helpers slightly.

Mark send_iommu_command() and invalidate_iommu_all() as static, as they have
no external declaration or callers.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/amd/iommu-defs.h
xen/drivers/passthrough/amd/iommu.h
xen/drivers/passthrough/amd/iommu_cmd.c
xen/drivers/passthrough/amd/iommu_init.c